//
//  Kylin_LoginRegisterViewController.m
//  03-BuDeJie-2 TabBar设置
//
//  Created by Kylin on 16/2/4.
//  Copyright © 2016年 kylin. All rights reserved.
//

#import "Kylin_LoginRegisterViewController.h"

@interface Kylin_LoginRegisterViewController ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *leftSpace;

@end

@implementation Kylin_LoginRegisterViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    
}

- (UIStatusBarStyle )preferredStatusBarStyle{
    return UIStatusBarStyleLightContent;
}
- (IBAction)close {
    
    [self dismissViewControllerAnimated:YES completion:nil];
}


// 点击屏幕时退出编辑模式
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self.view endEditing:YES];
}
// 设置点击时的业务逻辑
- (IBAction)LoginOrRegister:(UIButton *)button {
    
    if (self.leftSpace.constant == 0) {
        self.leftSpace.constant -= self.view.width;
        button.selected = YES;
    }else{
        self.leftSpace.constant = 0;
        button.selected = NO;
    }
    
    [UIView animateWithDuration:0.25 animations:^{
        [self.view layoutIfNeeded];
    }];
}

@end
